package com.mc.jf.utils;

import com.mc.jf.entity.PlanUser;
import org.springframework.security.core.context.SecurityContextHolder;

public class RoleUtil {

    public static PlanUser getUser() {
        return (PlanUser) SecurityContextHolder.getContext().getAuthentication().getPrincipal();
    }


    public static boolean isAdmin() {
        return getUser().getRole() == PlanUser.roleAdmin;
    }





}
